package org.example.school.job;

import org.example.school.business.HomeWorkInfo;
import org.example.school.business.StudentHomeworkInfo;
import org.example.school.business.TeacherInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class AttendanceJob {
    @Autowired
    private TeacherInfo teacherInfo;
    @Autowired
    private HomeWorkInfo homeWorkInfo;
    @Autowired
    private StudentHomeworkInfo studentHomeworkInfo;
    @Scheduled(cron = "0 0 18 * * ?")
    public void autoGenerateAttendanceRecords() {
        teacherInfo.autoGenerateAbsentRecords();
    }
    @Scheduled(cron = "0 */1 * * * ?")
    public void checkWorkStatus() {
        homeWorkInfo.autoGenerateSelectIsDue();
    }

    @Scheduled(cron = "0 */1 * * * ?")
    public void auroGenerateHomeworkRecords() {
        studentHomeworkInfo.auroGenerateHomeworkRecords();
    }



}
